package org.finalministry.objects.enums;

public enum FlagsTagsNotesEnum {

	FLAG(1L, "FLAG"), TAG(2L, "TAG"), NOTE(3L, "NOTE");

	private Long typeId;
	private String name;

	FlagsTagsNotesEnum(Long typeId, String name) {
		this.typeId = typeId;
		this.name = name;
	}

	public Long getTypeId() {
		return typeId;
	}

	public String getName() {
		return name;
	}

	public static FlagsTagsNotesEnum getByName(String name) {

		for (FlagsTagsNotesEnum ftn : values()) {
			if (ftn.name.equals(name)) {
				return ftn;
			}
		}

		return null;
	}

	public static FlagsTagsNotesEnum getByTypeId(Long typeId) {

		for (FlagsTagsNotesEnum ftn : values()) {
			if (ftn.typeId.equals(typeId)) {
				return ftn;
			}
		}

		return null;
	}
}
